package bishi.day21_5_18;

import java.util.Scanner;

/**
 * Mp3光标所在位置
 * @author 是阿秋啊
 * @date 2022/05/18 17:13
 **/
public class MP3_pre_here {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt();
            sc.nextLine();
            String str = sc.nextLine();
            int pre = 1;
            int begin = 1,total = 4;
            if(n <= 4) {
                total = n;
                for(int i = 0; i < str.length(); i++) {
                    if(str.charAt(i) == 'U') {
                        pre = --pre > 0 ? pre : n;
                    }else {
                        pre = ++pre > n ? 1 : pre;
                    }
                }
            }else {
                for(int i = 0; i < str.length(); i++) {
                    if(str.charAt(i) == 'U') {
                        if(pre == 1 && begin == 1) {
                            pre = n;
                            total = n;
                            begin = total - 3;
                        }else if(pre == begin) {
                            pre--;
                            begin--;
                            total--;
                        }else {
                            pre--;
                        }
                    }else {
                        if(pre == n && total == n) {
                            pre = 1;
                            begin = 1;
                            total = 4;
                        }else if(pre == total) {
                            pre++;
                            total++;
                            begin++;
                        }else {
                            pre++;
                        }
                    }
                }
            }
            for(int i = begin; i <= total; i++) {
                if(i == total) {
                    System.out.println(i);
                }else{
                    System.out.print(i + " ");
                }
            }
            System.out.println(pre);
        }
    }
}